package com.yunkeji.api.user.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunkeji.api.user.vo.BlackListVo;
import com.yunkeji.dao.mapper.UserBlackListMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/** @author 老张 */
public interface ApiUserBlackListMapper extends UserBlackListMapper {

    /**
     * 黑名单列表
     *
     * @author 老张
     */
    @Select(
            "SELECT "
                    + " users.id, "
                    + " ext.nick_name, "
                    + " users.sex, "
                    + " ext.age, "
                    + " users.online_status, "
                    + " users.disturb_flag, "
                    + " ext.head_url  "
                    + "FROM "
                    + " ykj_user_black_list list "
                    + " JOIN ykj_app_user users ON list.to_user_id = users.id  "
                    + " AND from_user_id = #{uid} "
                    + " LEFT JOIN ykj_app_user_ext ext ON ext.id = users.id")
    Page<BlackListVo> blackList(@Param("uid") Long userId, @Param("page") Page<Object> build);
}
